﻿using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.Time;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.Particle.Smoke
{
    public class SmokeStream : Container
    {
        private readonly Timer _smokeTimer;

        public SmokeStream(int smokeTickTime)
        {
            _smokeTimer = new Timer(smokeTickTime, true, SmokeTick);
            _smokeTimer.Start();
            AddTimers(_smokeTimer);
        }

        public void ChangeSmokeTickTime(int newTickTime)
        {
            _smokeTimer.Reset(newTickTime);
        }

        private void SmokeTick()
        {
            Playscreen.Map.AddParticle(new Smoke(AbsolutePosition));
        }
    }
}